package cn.loioi.multi.enums;

/**
 * <br>
 * (c) Copyright 2016 by <br>
 * @description :消息状态 <br>
 * @file_name :MessageState.java <br>
 * @system_name :multi_project_core <br>
 * @author :yyzh <br>
 * @创建时间 :2016年7月1日 下午11:22:16
 */
public enum MessageState {
	UN_READ(0, "未读"), READ(1, "已读");
	private int code;
	private String text;

	private MessageState(int code, String text) {
		this.code = code;
		this.text = text;
	}

	public int getCode() {
		return code;
	}

	public String getText() {
		return text;
	}

	public static MessageState parse(int code) {
		for (MessageState tmp : values()) {
			if (tmp.code == code) return tmp;
		}
		return null;
	}

	@Override
	public String toString() {
		return text;
	}
}
